//
//  AddressFooterView.m
//  NewPro
//
//  Created by RYX on 2018/10/19.
//  Copyright © 2018年 何荧红. All rights reserved.
//

#import "AddressFooterView.h"
#import "AddAddressViewController.h"

@implementation AddressFooterView

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setUI];
    }
    
    return self;
}

- (void)setUI{
    
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(25, 35, ScreenWidth - 50, 44)];
    btn.backgroundColor = [UIColor redColor];
    [btn setTitle:@"添加新地址" forState:UIControlStateNormal];
    [btn setBackgroundColor:BLUECOLOR];
    btn.layer.cornerRadius = 5;
    [btn addTarget:self action:@selector(onBtn) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:btn];
}

- (void)onBtn{
    
    AddAddressViewController *VC = [[AddAddressViewController alloc] init];
    [[self getCurrentViewController].navigationController pushViewController:VC animated:YES];
}
@end
